package com.breez.aiauth.common.util;

import java.util.HashMap;

public class R extends HashMap<String, Object> {
    private String msg;
    private Integer code;
    private Object data;

    public R() {
    }

    public static R  success() {
        R r = new R();
        r.put("msg", "ok");
        r.put("code", 0);
        return r;
    }
    public static R  success(Object data) {
        R r = new R();
        r.put("data",data);
        r.put("msg", "ok");
        r.put("code", 0);
        return r;
    }
    public static R success(String msg,Integer code) {
        R r = new R();
        r.put("msg", msg);
        r.put("code", code);
        return r;
    }
    public static R error(String msg,Integer code) {
        R r = new R();
        r.put("msg", msg);
        r.put("code", code);
        return r;
    }
    public static R error() {
        R r = new R();
        r.put("msg", "error");
        r.put("code", 500);
        return r;
    }
}
